*- open table or view first, and prepare array of field names
oMM = CREATE("MailMerge") && create object
*- set values
oMM.cAppTitle = "My Application" && application name, used in Alerts
oMM.nWordProc = nWordProc && word processor (1 = Word 6+; 2 = CommaDelim; or user-defined (see below); default = 1)
oMM.nNewDoc = nNewDoc && is it a new doc (1 = new, 2 = existing; default = 1)
oMM.nTemplate = nTemplate && type of main document (Word only, 1 = form letter; 2 = label; 3 = envelope; 4 = catalog; default = 1)
oMM.cDocName = cDocName && doc file if not new
oMM.cAlias = cTableAlias && alias of source table or view
oMM.cDBCTable = cTableName && table name if table is part of a DBC
oMM.cDBCName = cDatabaseName && DBC name if source table is part of a DBC
ACOPY(aMyFields, oMM.aAutoFields) && fill in array of field names to be used
oMM.Merge && do the merge
In the following example, the sample data table customer is used to create a new mailmerge form letter document in MS-Word (the defaults), using the customer.company and customer.city fields: